package cz.muni.fi.hauntedhouses.dao;

import cz.muni.fi.hauntedhouses.to.SkillTO;
import java.util.List;

/**
 *
 * @author Jan Volmut, 324836
 */
public interface SkillDAO {
    
    /**
     * Store the given skill.
     * Attributes name, description and power are mandatory.
     * 
     * @param skill skill to create
     * @throws NullPointerException on null given
     */
    public void create(SkillTO skill);
    
    /**
     * Finds a skill according to given id.
     * 
     * @param id of the skill to be found
     * @return Skill with given id or null if the id doesn't exist
     * @throws IllegalArgumentException if the id argument is null or less than 1
     */
    public SkillTO get(Long id);
    
    /**
     * Overrides the stored skill with the given one.
     * If the skill doesn't exist it is created properly.
     * 
     * @param skill the skill to be updated
     * @throws NullPointerException on null given
     */
    public void update(SkillTO skill);
    
    /**
     * Deletes given skill.
     * 
     * @param skill the skill to be deleted
     */
    public void delete(SkillTO skill);
    
    /**
     * Retrieves all stored skills
     * 
     * @return list<Skill> the list of all skills or null if there are no skills
     */
    public List<SkillTO> findAll();
    
    /**
     * Retrieves skill according to given name.
     * 
     * @param name the given name of skill to be found
     * @return Skill with the name or null if the skill doesn't exist
     */
    public SkillTO findByName(String name);
  
    
}
